home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 11 / AMUG BBS in a Box Volume XI (April 1994) (MacWizards).iso / Files / Tele / A / AnalyzeCL Utils.sit / CLAnalysis Stacks.sit / User Data / background_2163.txt next >
Encoding:
Text File  |  1989-05-23  |  4.4 KB  |  198 lines

  1. -- background: 2163 from stack: in
  2. -- bmap block id: 0
  3. -- flags: 4000
  4. -- background id: 0
  5. -- name: Graph
  6. ----- HyperTalk script -----
  7. on openCard
  8.   global lstfld, curfld
  9.   push recent card
  10.   if curfld = "" then put "0" into curfld
  11.   if lstfld <> curfld
  12.   then
  13.   graphY1 lstfld
  14.   put lstfld into curfld
  15. end if
  16. end opencard
  17.  
  18. on clearScreen full
  19.   choose select tool
  20.   if full = true then
  21.     doMenu select all
  22.   else
  23.     drag from 0,framebottom()-1 to 512,0
  24.   end if
  25.   doMenu clear picture
  26. end clearScreen
  27.  
  28. function frheight
  29. return 260
  30. end frameheight
  31.  
  32. function framewidth
  33. return 310
  34. end framewidth
  35.  
  36. function framebottom
  37. return 280
  38. end framebottom
  39.  
  40. function frameleft
  41. return 110
  42. end frameleft
  43.  
  44. function maxline what
  45. put 0 into result
  46. repeat with i = 1 to the number of lines in what
  47.   put max(line i of what,result) into result
  48. end repeat
  49. return result
  50. end maxLine
  51.  
  52. on drawframe  drawX
  53.   global y2ofs
  54.   reset paint
  55.   choose text tool
  56.   set the textFont to Geneva
  57.   set textSize to 9
  58.   set textAlign to Center
  59.   put the number of cards of bg "User Cards" into datacount
  60.   put frameleft() into horiz
  61.   put round(framewidth()/(dataCount-1)) into XStep
  62.   put round (14 / xstep) into num1
  63.   repeat with i = 1 to dataCount
  64.     if  drawX then
  65.       if  ( i mod num1 = 0) then
  66.         choose text tool
  67.         click at horiz,framebottom()+20
  68.         type i
  69.         doMenu Select
  70.         doMenu rotate right
  71.       end if
  72.       choose line tool
  73.       drag from horiz,framebottom()+3 to horiz,framebottom()
  74.     end if
  75.     add XStep to horiz
  76.   end repeat
  77.   choose line tool
  78.   subtract XStep from horiz
  79.   put horiz into y2ofs
  80.   drag from frameleft(),framebottom() to horiz,framebottom()
  81.   reset paint
  82.   choose browse tool
  83. end drawframe
  84.  
  85. on drawY  fld, algn, xpos
  86.   reset paint
  87.   choose text tool
  88.   set the textFont to Geneva
  89.   set textSize to 9
  90.   set textHeight to 9
  91.   set textAlign to algn
  92.   put maxLine (field fld) into maxY
  93.   if maxY < 18 then put maxY into incr else put 18 into incr
  94.   put the number of lines in field fld into datacount
  95.   put round(frheight()/incr) into Y1Step
  96.   put framebottom() into vert
  97.   repeat with i = 0 to incr
  98.     choose text tool
  99.     put round(maxY/incr*i) into ndx
  100.     put round(frheight()* ndx / maxY) into height1
  101.     click at xpos,framebottom()-height1
  102.     type round(maxY/incr*i) &  "_"
  103.     subtract Y1Step  from vert
  104.   end repeat
  105.   choose browse tool
  106. end drawY
  107.  
  108. on getData src,bkg,dst
  109.   global lstfld
  110.   put "" into field dst
  111.   if (the number of cards in background bkg) < 3 then
  112.     answer "No data! Use Load Data first." with "OK"
  113.     put "0" & return & "1" into field dst
  114.   else
  115.     repeat with i = 1 to the number of cards in background bkg
  116.       set the cursor to busy
  117.       put (field src of card i of background bkg) & return after field dst
  118.     end repeat
  119.   end if
  120. end getData
  121.  
  122. on drawgraph
  123.   reset paint
  124.   choose line tool
  125.   put maxLine (field Y1) into maxY
  126.   put the number of lines in field Y1 into datacount
  127.   put round(framewidth()/dataCount) into Y1Step
  128.   put frameleft() into horiz
  129.   put round(framewidth()/(dataCount-1)) into XStep
  130.   get line 1 of field Y1
  131.   repeat with i = 1 to dataCount
  132.     get line i of field  Y1
  133.     if it is not empty then
  134.       put round(frheight() * it / maxY) into height
  135.       drag from horiz,framebottom()-1 to horiz,framebottom()-height
  136.     end if
  137.     add XStep to horiz
  138.   end repeat
  139.   reset paint
  140.   choose browse tool
  141. end drawgraph
  142.  
  143.  
  144. on doLegend
  145.   global fldname
  146.   reset paint
  147.   lock screen
  148.   choose text tool
  149.   set textAlign to center
  150.   set textSize to 12
  151.   set textFont to Chicago
  152.   click at 400,40
  153.   type fldname
  154.   choose browse tool
  155. end doLegend
  156.  
  157. on graphY1  fld
  158.   global newdata, fldname
  159.   -- put "true" into newdata
  160.   clearscreen newdata
  161.   drawframe  newdata
  162.   put "false" into newdata
  163.   getdata  fld,"User Cards","Y1"
  164.   drawY "Y1",right,frameleft()-1
  165.   drawgraph "Y1",12,"Y1"
  166.   doLegend fldname
  167. end graphY1
  168.  
  169.  
  170.  
  171.  
  172. -- part 2 (field)
  173. -- low flags: 80
  174. -- high flags: 4000
  175. -- rect: left=5 top=9 right=28 bottom=110
  176. -- title width / last selected line: 0
  177. -- icon id / first selected line: 0 / 0
  178. -- text alignment: 0
  179. -- font id: 3
  180. -- text size: 12
  181. -- style flags: 0
  182. -- line height: 16
  183. -- part name: Name
  184.  
  185.  
  186. -- part 1 (field)
  187. -- low flags: 81
  188. -- high flags: 0000
  189. -- rect: left=3 top=63 right=255 bottom=69
  190. -- title width / last selected line: 0
  191. -- icon id / first selected line: 0 / 0
  192. -- text alignment: 0
  193. -- font id: 3
  194. -- text size: 12
  195. -- style flags: 0
  196. -- line height: 16
  197. -- part name: Y1
  198.